package com.arthur.service;

import com.arthur.entity.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

//@FeignClient(value = "MICROSERVICE-DEPT")
@FeignClient(value = "MICROSERVICE-DEPT",fallbackFactory=DeptClientServiceFallbackFactory.class)
public interface DeptClientService {
    /**
     * 添加部门
     */
    @RequestMapping(value = "/dept/add", method = RequestMethod.POST)
    public boolean addDept(@RequestBody Dept dept);
    /**
     * 根据id获取部门
     */
    @RequestMapping(value = "/dept/find/{id}", method = RequestMethod.GET)
    public Dept findById(@PathVariable("id") Long id);

    /**
     * 获取部门列表
     */
    @RequestMapping(value = "/dept/list", method = RequestMethod.GET)
    public List<Dept> findAll();
}
